package com.javaweb.controller;

import com.javaweb.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @desc:
 * @author: Ping
 * @date: 2024/11/30 14:29
 */

@Controller
public class SystemController {
    @GetMapping({"/","index"})
    public String index() {
        return "login" ;
    }


    @GetMapping("/show-thy")
    public String showThy(Model model) {
        // model
        model.addAttribute("name", "张三") ;
        model.addAttribute("needMessage", true) ;
        model.addAttribute("users", List.of(
            new User().setName("zhangsan"),
            new User().setName("lisi"),
            new User().setName("wangwu"),
            new User().setName("zhaoliu")
        )) ;

        // view
        return "showThy" ;

    }


}
